package com.ruoyi.repayment.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.utils.StringUtils;
import lombok.Data;
import org.springframework.util.DigestUtils;

@TableName("loan_user")
@Data
public class User {
    private Long id;

    private String phone;


    private String getUsername;
    private String getPassword;

    public String getPassword() {
        String password = "";
        if (StringUtils.isNotBlank(getPassword)) {
            password = DigestUtils.md5DigestAsHex(getPassword.getBytes());
        }
        return password;
    }

    public String getUsername() {
        String username = "";
        if (StringUtils.isNotBlank(getUsername)) {
            username = getUsername;
        }
        return username;
    }

    public String getEmail() {
        String email = "";
        if (StringUtils.isNotBlank(phone)) {
            email = phone;
        }
        return email;
    }
}
